﻿using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;
using Microsoft.Xna.Framework.Net;
using Microsoft.Xna.Framework.Storage;

namespace _0712502_0712504_DesignPatternGame
{
    public class GamePlay
    {
        public bool _isFinished = false;
        private MyMap mMyMap;

        private PlayingGame mPlayingGame;
        GamePlayContex gamePlayContext;
        public GamePlay()
        {
            mMyMap = new MyMap();
            mPlayingGame = new PlayingGame();
            gamePlayContext = GamePlayContex.PlayingGame;
        }

        public void Initilize()
        {
            mPlayingGame.Initilize();
        }
        public void KhoiTaoManChoi()
        {
            mMyMap.LoadNewStage();
            mPlayingGame.LoadNewStage(ref mMyMap);
        }

        public void Update(GameTime gameTime)
        {
            switch (gamePlayContext)
            {
                case GamePlayContex.PlayingGame:
                    {
                        mPlayingGame.Update(gameTime);
                        break;
                    }
            }
        }

        public void DrawToScreen(GameTime gameTime, SpriteBatch spriteBatch)
        {
            switch (gamePlayContext)
            {
                case GamePlayContex.PlayingGame:
                    mPlayingGame.DrawToScreen(gameTime, spriteBatch);
                    break;
            }
        }
    }
}
